home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1995 January / 1995-01b.d64 / file un_lock (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  608b  |  15 lines

  1. 10 print"lock/unlock files"                :
  2. 15 input"file name";n$:iflen(n$)<1orlen(n$)>16thenprint"wrong length":goto15
  3. 20 close15:open15,8,15:print#15,"i0:":close5:open5,8,5,"#":t=18:s=1
  4. 25 print#15,"u1:"5;0;t;s:print#15,"b-p:5,0":get#5,t$:get#5,s$
  5. 30 fori=2to255step32:j=0:x$="":print#15,"b-p:"5;i:print".";
  6. 35 get#5,y$:x=asc(y$+chr$(0)):get#5,y$:get#5,y$:ifx<128then65
  7. 40 get#5,y$:ify$<>chr$(160)andlen(x$)<16thenx$=x$+y$:goto40
  8. 45 ifn$<>x$then65
  9. 50 x=not(xand64)and(xor64):remflip lock
  10. 55 print#15,"b-p"5;i:print#5,chr$(x);:print#15,"u2:"5;0;t;s
  11. 60 print:print"file now "mid$("un",(xand64)+1,2)"locked":i=999:next:goto75
  12. 65 next:t=asc(t$+chr$(0)):s=asc(s$+chr$(0)):ift<>0then25
  13. 70 print" no match found [146]"
  14. 75 input#15,er,er$:print"disk status"er;er$:print#15,"i0:":close15:end
  15.